-
Notifications
You must be signed in to change notification settings - Fork 7
KSparseBallLMO #268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
KSparseBallLMO #268
Conversation
… situations, so further improvements are needed.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #268 +/- ##
==========================================
- Coverage 86.23% 84.70% -1.53%
==========================================
Files 17 22 +5
Lines 1482 2753 +1271
==========================================
+ Hits 1278 2332 +1054
- Misses 204 421 +217 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
There is only DiamondLMO(L1) and KsparseLMO |
|
Now is only Ksparse |
src/polytope_blmos.jl
Outdated
| struct KSparseBLMO <: FrankWolfe.LinearMinimizationOracle | ||
| K::Int | ||
| right_hand_side::Float64 | ||
| end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not necessary.
src/polytope_blmos.jl
Outdated
| function bounded_compute_extreme_point( | ||
| lmo::KSparseBLMO, | ||
| direction, | ||
| lb, | ||
| ub, | ||
| int_vars; | ||
| v=nothing, | ||
| kwargs..., | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
function bounded_compute_extreme_point(
lmo::FrankWolfe.KSparseLMO{T},
direction,
lb,
ub,
int_vars;
v=nothing,
kwargs...
)
..
end
|
|
||
| for i in 1:n_int | ||
| v = clamp(τ, lb[i], ub[i]) | ||
| if abs.(v) .> τ + tol |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the broadcasting is not needed here since v is a scalar.
test/heuristics.jl
Outdated
|
|
||
| n = 20 | ||
| sparsity = 0.3 | ||
| x_sol = [rand() < sparsity ? 0 : rand(1:floor(Int, n / 4)) for _ in 1:n] | ||
| n_int = 17 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove not needed.
src/polytope_blmos.jl
Outdated
|
|
||
| """ | ||
| KSparseLMO{T}(K::Int, right_hand_side::T) | ||
| LMO for the K-sparse polytope: | ||
| ``` | ||
| C = B_1(τK) ∩ B_∞(τ) | ||
| ``` | ||
| with `τ` the `right_hand_side` parameter. | ||
| The LMO results in a vector with the K largest absolute values | ||
| of direction, taking values `-τ sign(x_i)`. | ||
| """ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a description/sketch the idea of function,
1.Extend the Polytope LMOs from FW to Boscia: KNormBallLMO, DiamondLMO (generalisation of the L1-norm ball), KSparseLMO
2.For the DiamondLMO, the L1 norm version is the only implemented,a diamond constraint can be inputed, but the result will most likely be incorrect because it implements L1 norm. haven't figured out how to implement a diamond constraint yet.